<template>
  <div>
    <!-- 直接在组件中获取数据 不好维护和阅读 -->
    <h2>Count插值拿:{{ $store.state.count }}</h2>
    <h2>num插值拿:{{ $store.state.num }}</h2>

    <h2>Count计算属性拿:{{ count }}</h2>
    <h2>num计算属性拿:{{ num }}</h2>
  </div>
</template>

<script>

export default {
  name: "count",
  computed: {
    count() {
      return this.$store.state.count;
    },
    num() {
      return this.$store.state.num;
    },
  },
};
</script>

<style></style>
